package a.h;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

class zb
{
  private List a;
  private List b;
  private Object c;
  
  public zb(Object paramObject)
  {
    this(paramObject, 0);
  }
  
  public zb(Object paramObject, int paramInt)
  {
    this.a = new ArrayList(paramInt);
    this.b = new ArrayList();
    this.c = paramObject;
  }
  
  public ib a(ib paramib)
  {
    int i = ec.t;
    boolean bool = ec.s;
    if ((i != 0) || (paramib == null)) {
      return paramib;
    }
    Iterator localIterator = this.a.iterator();
    while (localIterator.hasNext()) {
      if (paramib == ((WeakReference)localIterator.next()).get())
      {
        if ((i != 0) || (bool)) {
          break label90;
        }
        return paramib;
      }
    }
    this.a.add(new WeakReference(paramib));
    d(paramib);
    label90:
    return paramib;
  }
  
  public void b(ib paramib)
  {
    if (paramib == null) {
      return;
    }
    Iterator localIterator = this.a.iterator();
    while (localIterator.hasNext()) {
      if (paramib == ((WeakReference)localIterator.next()).get())
      {
        localIterator.remove();
        e(paramib);
        return;
      }
    }
  }
  
  public List a()
  {
    int i = ec.t;
    boolean bool = ec.s;
    ArrayList localArrayList = new ArrayList(this.a.size());
    Iterator localIterator = this.a.iterator();
    if (localIterator.hasNext()) {}
    label92:
    while (i != 0)
    {
      Object localObject = ((WeakReference)localIterator.next()).get();
      if (i == 0)
      {
        if (localObject == null)
        {
          localIterator.remove();
          if (i != 0) {
            break label92;
          }
          if (!bool) {
            break;
          }
        }
        localArrayList.add(localObject);
      }
      if (!bool) {
        break;
      }
    }
    return localArrayList;
  }
  
  public void a(ib.a_ parama_)
  {
    this.b.add(parama_);
  }
  
  public void b(ib.a_ parama_)
  {
    this.b.remove(parama_);
  }
  
  void a(a_ parama_)
  {
    int j = ec.t;
    boolean bool = ec.s;
    ArrayList localArrayList = new ArrayList(this.a.size());
    Iterator localIterator = this.a.iterator();
    ib localib;
    label98:
    label100:
    label103:
    do
    {
      do
      {
        do
        {
          if (!localIterator.hasNext()) {
            break label103;
          }
          localib = (ib)((WeakReference)localIterator.next()).get();
          if (j != 0) {
            break label98;
          }
          if (localib == null) {
            break;
          }
          localArrayList.add(localib);
          if (j != 0) {
            break label100;
          }
        } while (!bool);
        localIterator.remove();
      } while (!bool);
    } while (j != 0);
    int i = 0;
    do
    {
      if (i >= localArrayList.size()) {
        break;
      }
      localib = (ib)localArrayList.get(i);
      parama_.a(localib);
      i++;
    } while (!bool);
  }
  
  private void d(ib paramib)
  {
    int j = ec.t;
    boolean bool = ec.s;
    if ((j != 0) || (!this.b.isEmpty()))
    {
      ib.a_[] arrayOfa_ = new ib.a_[this.b.size()];
      this.b.toArray(arrayOfa_);
      ib.b_ localb_ = new ib.b_(this.c, paramib);
      int i = 0;
      do
      {
        if (i >= arrayOfa_.length) {
          break;
        }
        arrayOfa_[i].a(localb_);
        i++;
      } while (!bool);
    }
  }
  
  private void e(ib paramib)
  {
    int j = ec.t;
    boolean bool = ec.s;
    if ((j != 0) || (!this.b.isEmpty()))
    {
      ib.a_[] arrayOfa_ = new ib.a_[this.b.size()];
      this.b.toArray(arrayOfa_);
      ib.b_ localb_ = new ib.b_(this.c, paramib);
      int i = 0;
      do
      {
        if (i >= arrayOfa_.length) {
          break;
        }
        arrayOfa_[i].b(localb_);
        i++;
      } while (!bool);
    }
  }
  
  static abstract interface a_
  {
    public abstract void a(ib paramib);
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.h.zb
 * JD-Core Version:    0.7.0.1
 */